package stableproject;

import java.util.List;

import japa.parser.ast.body.ClassOrInterfaceDeclaration;
import japa.parser.ast.type.ClassOrInterfaceType;
import japa.parser.ast.visitor.GenericVisitorAdapter;

public class ClassVisitor<String> extends GenericVisitorAdapter {

	public String extendz;
	public String name;

	/**
	 * Returns the name of the class
	 */
	@Override
	public String visit(ClassOrInterfaceDeclaration n, Object arg) {
		// cleanse the fields
		cleanse();

		// set the extends
		if (n.getExtends() != null)
			extendz = (String) n.getExtends().get(0).getName();

		// set the name
		name = ((String) n.getName());

		// return classname
		return name;

	}

	private void cleanse() {
		extendz = (String) "";
		name = (String) "";

	}

	public String getExtends() {
		return extendz;
	}

}